Stored Procedures [dbo].[BAEOrderAttributeCheckForChildProducts]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@OrderAttributeIdint4
SQL Script
create procedure [dbo].[BAEOrderAttributeCheckForChildProducts] @OrderAttributeId int as
DECLARE     @dummy int

    SELECT    @dummy = CPA.OrderSuperProductChildProductID
    FROM        OrderSuperProductAttribute SPA INNER JOIN OrderSuperProductAttributeValue SPAV ON
            (SPA.OrderSuperProductAttributeID = SPAV.OrderSuperProductAttributeID) INNER JOIN OrderSuperProductChildProductAttribute CPA ON
            (SPAV.OrderSuperProductAttributeValueID = CPA.OrderSuperProductAttributeValueID)
    WHERE    SPA.OrderSuperProductAttributeID = @OrderAttributeId

    IF @@ROWCOUNT > 0
        BEGIN
            SELECT 0 'DELETE'
        END
    ELSE
        BEGIN
            SELECT 1 'DELETE'
        END

GO
Uses